package com.yq.reggie.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * mp的配置类
 */
@Configuration
public class MybatisPlusConfig {
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        //创建mp的拦截器
        MybatisPlusInterceptor mpi = new MybatisPlusInterceptor();
        //给mp拦截器添加分页拦截器
        mpi.addInnerInterceptor(new PaginationInnerInterceptor());

        return mpi;
    }
}
